package com.dotflat.staffExtend.controller;

import com.dotflat.check.domain.Checker;
import com.dotflat.check.po.CheckerPO;
import com.dotflat.check.service.CheckerService;
import com.dotflat.rest.controller.RestfulBaseController;
import com.dotflat.staffExtend.domain.StaffExtendCareer;
import com.dotflat.staffExtend.dto.StaffExtendStatisticsDTO;
import com.dotflat.staffExtend.po.StaffExtendCareerPO;
import com.dotflat.staffExtend.repository.StaffExtendInfoRankCircleRepository;
import com.dotflat.staffExtend.service.StaffExtendCareerService;
import com.matt.commons.dto.sso.StaffDTO;
import com.matt.commons.model.StatusResponse;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.matt.foundation.constant.RequestConstant.TICKET;

@RestController
@RequestMapping("/api/staff_extend/career")
@Slf4j
@Api(tags = "员工扩展信息 - 履历 - 教育经历")
public class APIStaffExtendCareerController extends RestfulBaseController<StaffExtendCareer, StaffExtendCareerService, StaffExtendCareerPO> {

    @Autowired
    public void setBaseService(StaffExtendCareerService service){
        super.setBaseService(service);
    }

    @Autowired
    private StaffExtendCareerService careerService;


    @ApiOperation(value = "师资 - 教师学习排行榜")
    @PostMapping("/ranking")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = CheckerPO.class),
    })
    public StatusResponse ranking(@RequestHeader(TICKET) String ticket){
        List<StaffExtendStatisticsDTO> list = careerService.ranking(ticket);
        return StatusResponse.success(list);
    }

}
